using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace JumpBall_2
{
    public enum GameState
    {
        Wait = 0,
        Start,
        Pause,
        End
    }

    public class GameManager : MonoBehaviour
    {
        private static GameManager intance = null;

        public GameObject menu;
        public static GameManager Instance
        {
            get => intance;
        }

        private void Awake()
        {
            intance = this;
        }

        private GameState state;
        public GameState gameState
        {
            get => state;
        }

        public void GameStart()
        {
            state = GameState.Start;        //游戏启动
            if (menu)
            {
                menu.SetActive(false);
            }

        }

        public void GameOver()
        {
            state = GameState.End;

            Scene current = SceneManager.GetActiveScene();
            SceneManager.LoadScene(current.name);
        }
    }
}